import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store'
import 'github-markdown-css'
import 'markdown-it-latex/dist/index.css'
import 'markdown-it-icons/dist/index.css'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/index.scss'

Vue.use(ElementUI);
Vue.config.productionTip = false

const requireComponent = require.context(
    // 其组件目录的相对路径
    './components/',
    // 是否查询其子目录
    true,
    // 匹配基础组件文件名的正则表达式
    /main\.(vue|js)$/i
)
requireComponent.keys().forEach(fileName => {
  // 获取组件配置
  const componentConfig = requireComponent(fileName)
  const componentName = componentConfig.name?componentConfig.name:componentConfig.default.name
  // 全局注册组件
  Vue.component(componentName,componentConfig.default || componentConfig)
})



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

